<!-- TinyMCE -->
<script type="text/javascript" src="../../../asset/scripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
	tinyMCE.init({
		// General options
		mode : "textareas",
		theme : "simple",
		plugins : "paste",

		theme_advanced_toolbar_location : "top", 
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true
	});	
</script>

<script type="text/javascript">
var qty = 0;
var amount = 0;
function hitungTotal(totalcont,val){
	//alert(totalcont.id);
	totalcont.value = (this.qty * this.amount);
}
function setQty(qty){
	this.qty = qty.value;
}
function setAmount(amt){
	this.amount = amt.value;
}
function onlyNumbers(evt) 
{
	evt = (evt) ? evt : window.event
	var charCode = (evt.which) ? evt.which : evt.keyCode
	if (charCode > 31 && (charCode < 48 || charCode > 57)) {
		//status = "This field accepts numbers only."
		alert("Harus di Isi Angka");
		return false
	}
	//status = ""
	return true 	
}
</script>
<? echo "erick"; ?>
{transretur}
<form method="post" name="frmEdit" action="<?php echo site_url('returpembeliancontroller/ubahreturpembelian');?>">
    <h3 align="center"><u><strong>EDIT RETUR PEMBELIAN</strong></u> </h3>
    <table width="100%" cellpadding="3" cellspacing="0" border="1">
        <tr>
            <td width="131"><strong>No Retur</strong></td>
            <td width="24" align="center"><strong>:</strong></td>
            <td width="759" colspan="3"><input type="text"  name="kdretur" id="kdretur" maxlength="12" size="25" value="{ReturnNo}" readonly="readonly" /></td>
        </tr>
        <tr>
            <td width="131"><strong>Nama supplier</strong></td>
            <td width="24" align="center"><strong>:</strong></td>
            <td ><input type="text"  name="nmsupp" id="nmsupp" maxlength="12" size="25" value="{suppliername}" readonly="readonly" />
            <input type="hidden"  name="kdsupp" id="kdsupp" maxlength="12" size="25" value="{Kodesupplier}" readonly="readonly" />
            
            <!--<select name="kdsupp">
            		<option value="{KodeSupplier}">{Suppliername}</option>
                    <?php 
						$count = count($mastersupp);
                    	foreach($mastersupp as $comboInd)
						{
                    ?>
                    	<option value="<?php echo $comboInd->Kodesupplier?>"><?php echo $comboInd->suppliername;?></option>
                    <?php }?>
                </select>--></td>
        </tr>
        <tr>
            <td width="131"><strong>Keterangan</strong></td>
            <td width="24" align="center"><strong>:</strong></td>
            <td ><input type="text"  name="keterangan" id="keterangan" size="50" maxlength="100" value="{Keterangan}" /></td>
        </tr>
	</table>
    <br />
     <table width="100%" cellpadding="3" cellspacing="0" border="1">
    	<tr style="background-color:#FFF; color:#000000;" align="center">
        	<td colspan="3" height="25"><strong>Detail Retur Pembelian</strong></td>
    	</tr>
        <tr>
            <td width="131"><strong>Nama Barang</strong></td>
            <td width="23" align="center"><strong>:</strong></td>
            <td width="760" >
            	<select name="kdbarang">
                	<option value="{KodeDetailBarang}">{Productname}</option>
                    <?php 
						$count = count($masterbarang);
                    	foreach($masterbarang as $comboInd)
						{
                    ?>
                    	<option value="<?php echo $comboInd->KodeDetailBarang?>"><?php echo $comboInd->Productname;?></option>
                    <?php }?>
                </select></td>
                <input type="hidden"  name="kdbarangawal" id="kdbarangawal" size="50" maxlength="4" value="{KodeDetailBarang}" />
                <input type="hidden"  name="kdiddetail" id="kdiddetail" size="50" maxlength="11" value="{IDdetail}" />
        </tr>
        <tr>
            <td width="131"><strong>Harga Barang</strong></td>
            <td width="23" align="center"><strong>:</strong></td>
            <td ><input type="text"  name="hrgbarang" id="hrgbarang" size="50" maxlength="11" value="{HargaBarang}" onkeyup="javascript:setAmount(this);" onkeypress="return onlyNumbers(event);"/></td>
        </tr>
        <tr>
            <td width="131"><strong>Quantity</strong></td>
            <td width="23" align="center"><strong>:</strong></td>
            <td ><input type="text"  name="qty" id="qty" size="50" maxlength="4" value="{QTY}" onkeyup="javascript:setQty(this);" onkeypress="return onlyNumbers(event);"/>
            	<input type="hidden"  name="jmlhqtyawal" id="jmlhqtyawal" size="50" maxlength="4" value="{QTY}" />
            </td>
        </tr>
        <tr>
            <td width="131"><strong>Discount</strong></td>
            <td width="23" align="center"><strong>:</strong></td>
            <td ><input type="text"  name="distcoun" id="distcoun" size="50" maxlength="4" value="{Discount}" onkeypress="return onlyNumbers(event);"/></td>
        </tr>
        <tr>
            <td width="131"><strong>Jumlah Haraga</strong></td>
            <td width="23" align="center"><strong>:</strong></td>
            <td ><input type="text"  name="jmlhhrg" id="jmlhhrg" size="50" maxlength="11" value="{Amount}" onmousedown="javascript:hitungTotal(this,0);"/></td>
        </tr>
        <tr>
            <td colspan="3" align="center"><input type="submit" value="Save" name="btnSave" >&nbsp;<input type="button" name="btnClose" value="Back" class="btn" onclick="javascript:history.back(1);" /></td>
        </tr>
    </table>
</form>
{/transretur}